package com.neuedu.his.controller;


import com.neuedu.his.entity.CheckApply;
import com.neuedu.his.service.CheckApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/CheckApply")
public class CheckApplyController {

    @Autowired
    CheckApplyService CheService;

    @RequestMapping("/selectAll")
    // http://localhost:8088/CheckApply/selectAll
    public List<CheckApply> selectAll(CheckApply che){
        return CheService.selectAll(che);
    }

    @RequestMapping("selectByName")
    // http://localhost:8088/CheckApply/selectByName?name=小
    public List<CheckApply> selectByName(CheckApply che){
        return CheService.selectByName(che);
    }

    @RequestMapping("/selectById")
    // http://localhost:8088/CheckApply/selectById?id=1
    public CheckApply selectById(CheckApply che){
        return CheService.selectById(che);
    }

    @RequestMapping("/selectByState")
    // http://localhost:8088/CheckApply/selectByState?state=2
    public List<CheckApply> selectByState(CheckApply che){
        return CheService.selectByState(che);
    }

    @RequestMapping("/selectByRegistId")
    // http://localhost:8088/CheckApply/selectByRegistId?registid=26
    public List<CheckApply> selectByRegistId(CheckApply che){
        return CheService.selectByRegistId(che);
    }

    @RequestMapping("/updateToS")
    // http://localhost:8088/CheckApply/updateToS?id=52
    public int updateToStorage(CheckApply che) {
        return CheService.updateToStorage(che);
    }

    @RequestMapping("/updateToO")
    // http://localhost:8088/CheckApply/updateToO?id=52
    public int updateToOpen(CheckApply che) {
        return CheService.updateToOpen(che);
    }

//    @RequestMapping("/updateToDefinite")
//    // http://localhost:8088/CheckApply/updateToDefinite?id=52
//    public int updateToDefinite(CheckApply che){
//        return CheService.updateToDefinite(che);
//    }


    @RequestMapping("/update")
    // http://localhost:8088/CheckApply/update?itemid=1&name=1&objective=1&position=头部
    // &isurgent=1&num=1&creationtime=2020-03-28 15:26:19&doctorid=1&checkoperid=1&resultoperid=1&result=1&resulttime=2019-03-28 15:26:29&recordtype=1&id=46
    public int update(CheckApply che){
        return CheService.update(che);
    }

    @RequestMapping("/delete")
    // http://localhost:8088/CheckApply/delete?id=43
    public int delete(CheckApply che){
        return CheService.delete(che);
    }
}
